@extends('admin_system/public/layout')
@section('content')
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">
                用户历史消息管理
            </h3>
            <br>
            <form action="/admin_system/live/send_msg_view">
                <input type="hidden" name="group_id" value="{{$group_id}}">
                <button class="btn btn-danger" type="submit">发送消息</button>
            </form>
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>手机号</th>
                        <th>消息</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($student_msg as $k=>$v)
                        <tr>
                            <td>
                                {{$v->user_name}}
                                <img src="{{$v->avg}}" alt="" width="40" height="40">
                            </td>
                            <td>{{$v->account}}</td>

                            @if(json_decode($v->msg,true)['type']===1)
                                <td>{{json_decode($v->msg,true)['content']}}</td>
                            @elseif(json_decode($v->msg,true)['type']===2)
                                <td><img src="{{json_decode($v->msg,true)['content']}}" width="50" height="50"></td>
                            @endif
                            <td>
                                {{--<form action="/admin_system/live/send_msg_view">--}}
                                {{--<input type="hidden" name="group_id" value="{{$v->group_id}}">--}}
                                {{--<button class="btn" type="submit">发送消息</button>--}}
                                {{--</form>--}}
                                {{$v->msg}}
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                {!! $student_msg->appends(['group_id'=>$group_id])->links() !!}
            </div>
        </div>
    </div>
@endsection